home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / park.c < prev    next >
Text File  |  1985-06-03  |  768b  |  30 lines

  1. #include <stdio.h>
  2.  
  3. /*
  4. **  park fixed disk heads
  5. */
  6.  
  7. main()
  8. {
  9.     int cyl;
  10.     struct {int ax,bx,cx,dx,si,di,ds,es;}srv;
  11.  
  12.     srv.ax = 0x0800;
  13.     srv.dx = 0x0080;
  14.  
  15.     /* get fixed disk drive parameters */
  16.  
  17.     if ( sysint ( 0x13, &srv, &srv ) & 1 )
  18.         abort ("park: Drive parms NOT returned\n");
  19.  
  20.     srv.ax = 0x0c00;            /* set 'seek' command */
  21.     cyl = ((srv.cx & 0x00c0)<<2) | ((srv.cx & 0xff00)>>8);
  22.     srv.dx = 0x0080;
  23.  
  24.     if ( sysint ( 0x13, &srv, &srv ) & 1 ) /* park the heads */
  25.         abort ("park: Drive C: FAILED to park - error = %02xh\n",
  26.               (srv.ax & 0xff00)>>8);
  27.     else
  28.         printf("park: Drive C: parked at cylinder %d\n", cyl);
  29. }
  30.